/*
 * @Author: Starfish_DL
 * @Date: 2020-09-30 20:48:13
 * @LastEditors: Starfish_DL
 * @LastEditTime: 2020-09-30 20:53:49
 * @CurrentVersion: 1.0
 * @Description: 
 */

public class TestTransfer {
    public static void swap(DataSwap ds) {
        int tmp = ds.a;
        ds.a = ds.b;
        ds.b = tmp;
        System.out.println("swap方法里，a Field的值是"+ ds.a + "；b Field的值是" + ds.b);
    }

    public static void main(String[] args) {
        DataSwap ds = new DataSwap();
        ds.a = 6;
        ds.b = 9;
        System.out.println("交换结束前，a Field的值是"+ ds.a + "；b Field的值是" + ds.b);
        swap(ds);
        System.out.println("交换结束后，a Field的值是"+ ds.a + "；b Field的值是" + ds.b);
    }
}
